package com.zhanglu.authentication.mapper;

import com.zhanglu.authentication.common.ResultMapper;
import com.zhanglu.authentication.entity.AuthRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @description
 * @Auther zhanglu
 * @Date 2017/9/20 下午1:59
 */
@Mapper
public interface AuthRoleMapper extends ResultMapper<AuthRole> {
    @Select("select ar.role_name from auth_role ar,auth_user au,auth_user_role aur where ar.id = aur.role_id and au.id = aur.user_id and au.id = #{userId}")
    List<String> getRoleNames(Long userId);
}
